package com.snoweagler.verify;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.security.web.authentication.AuthenticationSuccessHandler;

@Configuration
public class VerifyConfig {

    @Bean
    public AuthenticationSuccessHandler authenticationSuccessHandler(){
        return new AuthentionSuccessFilter();
    }

    @Bean
    public AuthenticationFailureHandler authenticationFailureHandler(){
        return new AuthentionFailerFilter();
    }

    @Bean
    public UserDetailsService userDetailsService(){
        return new UserDetailsServiceImpl();
    }
}
